package com.foot.travel.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;

import com.foot.travel.R;
import com.koalac.ironman.common.module.ModuleActivity;
import com.koalac.ironman.util.GBLActivityManager;
import com.koalac.ironman.viewhelper.ViewInject;

public class PayFinishActivity extends ModuleActivity implements
	OnClickListener {

    @ViewInject(id = R.id.check_order, click = "onClick")
    Button mCheckOrderBtn;
    public static final String ORDER_ID = "order_id";
    public static final String FROM = "from";

    public static final String ORDER_DETAIL = "order_detail";
    public static final String PAY_ORDER = "pay_order";

    String mOrderId;
    String mFrom;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setBackButtonVisibility(true);
	setNavigationTitle("支付完成");
	mOrderId = getIntent().getStringExtra(ORDER_ID);
	mFrom = getIntent().getStringExtra(FROM);

    }

    @Override
    protected void onBackButtonClicked(View v) {
	// if (mFrom.equals(ORDER_DETAIL)) {
	GBLActivityManager.getActivityManager().popAllActivityExceptOne(
		MainActivity.class);
	// }else {
	// GBLActivityManager.getActivityManager().popAllActivityExceptOne(MainActivity.class);
	// }
    }

    @Override
    protected void initLayout(ViewGroup rootContentView) {
	addContentView(R.layout.activity_pay);
    }

    @Override
    public void onClick(View v) {
	int viewID = v.getId();
	switch (viewID) {
	case R.id.check_order:
	    Intent intent = new Intent(PayFinishActivity.this,
		    OrderDetailActivity.class);
	    intent.putExtra(OrderDetailActivity.ORDER_ID, mOrderId);
	    startActivity(intent);
	    break;

	default:
	    break;
	}
    }

}
